

<!-- 
All rights Reserved, Designed By www.youyacao.com 
@Description:倒计时广告
@author:成都市一颗优雅草科技有限公司     
@version V3.0
@松鼠聚合直播系统
注意：本前端源码遵循 蜻蜓优雅草产品开源授权协议，本内容仅限于个人参考，禁止用于其他的商业用途
需要商业用途或者定制开发等可访问songshu.youyacao.com   联系QQ:422108995 23625059584

 -->








<template>
	<view style="height: 100vh; overflow: hidden;">
		<image :src="splash" style="width: 100%; height: 100vh;" @click="openLink()"></image>
		<view class="daojishi-box" @click="closeScreen()">{{daojishi}}</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				splash:"../../static/screen.jpg",
				linkPath:"",
				daojishi:"6S",
				daojishiTime:6,
				daojiTimer:null,
				screenImage:null
			}
		},
		onLoad() {
			var that = this;
			var splash = uni.getStorageSync("splash_img"),splash_link = uni.getStorageSync("splash_link");
			if(splash) this.splash = splash;
			if(splash_link) this.linkPath = splash_link;
			this.daojiTimer = setInterval(()=>{
			  that.daojishiTime--;
			  that.daojishi = that.daojishiTime >0 ? that.daojishiTime +"S" : "进入";
			  if(that.daojishiTime<=0) {
				  clearInterval(that.daojiTimer)
				  uni.reLaunch({
				  	url: '/pages/index/index'
				  })
			  }
			},1000);
		},
		methods: {
			closeScreen:function(){
				uni.reLaunch({
					url: "/pages/index/index"
				});
			},
			openLink:function(){
				if(this.linkPath) plus.runtime.openURL(this.linkPath);
			}
		}
	}
</script>

<style>
.daojishi-box{
  background: grey;
  opacity: 0.7;
  position: absolute;
  top: 50px;
  right: 30px;
  border-radius: 20rpx;
  padding: 10rpx 20rpx;
  width: 90rpx;
  height: 40rpx;
  text-align: center;
  font-size: 30rpx;
  color: white;
}
</style>
